//***********************************************************************
//    PairOfDice.java 		Author:GK
// 
//    定义两个设置和获取它们的方法、一个掷骰子的方法及一个返回当前两个骰
//    子和值的方法。
//***********************************************************************

public class PairOfDice
{
    private final int MAX = 6;
    private int faceValue1, faceValue2;

    public PairOfDice()
    {
        faceValue1 = 1;
	faceValue2 = 1;
    }

    public int roll()
    {
        faceValue1 = (int)(Math.random() * MAX) + 1;
	return faceValue1;
    }

    public int getFaceValue1()
    {
        return faceValue1;
    }

    public int getFaceValue2()
    {
        return faceValue2;
    }

    public void setFaceValue1(int a)
    {
        faceValue1 = a;
    }

    public void setFaceValue2(int b)
    {
        faceValue2 = b;
    }

    public int sum()
    {
        int sum;
	sum = faceValue1 + faceValue2;
	return sum;
    }
}
